import http from "@/api/axios";

export const getListApi = (data: WarehouseEntryChannel.SearchForm) => {
  return http({
    method: "post",
    url: "/base/biz/bizWarehouseChannel/page",
    data
  });
};
export const addChannelApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/bizWarehouseChannel/save",
    data
  });
};
export const editChannelApi = (data: Base.GeneraDataType) => {
  return http({
    method: "POST",
    url: "/base/biz/bizWarehouseChannel/updateChannel",
    data
  });
};
export const updateChannelApi = (data: WarehouseEntryChannel.AddForm) => {
  return http({
    method: "post",
    url: "/base/biz/bizWarehouseChannel/updateStatus",
    data
  });
};
export const getChannelInfoApi = (channelId: string) => {
  return http({
    method: "get",
    url: `/base/biz/bizWarehouseChannel/selectById/${channelId}`
  });
};
export const getTreeChannelApi = (params?: Base.GeneraDataType) => {
  return http({
    method: "get",
    url: "/base/biz/bizWarehouseChannel/selectChannelTypeList",
    params
  });
};
// 获取当前渠道 支持的国家
export const getCountryByChannelApi = (data: Base.GeneraDataType = {}) => {
  return http({
    method: "post",
    url: "/base/biz/bizWarehouseChannelContry/listByChannelId",
    data
  });
};
// 保存报价
export const keepQuotationApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: "/base/biz/quotation",
    data
  });
};
// 获取报价信息
export const getQuotationInfoApi = (data: { id: string }) => {
  return http({
    method: "post",
    url: `/base/biz/quotation/info`,
    data
  });
};

// 报价历史管理 - 报价信息
export const getHistoryInfoApi = (data: { channelId: string; quotationHistoryId: string }) => {
  return http({
    method: "post",
    url: `/base/biz/quotation/history/info`,
    data
  });
};

// 报价历史管理 - 保存
export const changeHistoryInfoApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/quotation/history`,
    data
  });
};

// 获取天图的全部渠道带出仓代理的id(outWarehouseId)
export const getTttxAllServiceApi = (data: Base.GeneraDataType) => {
  return http({
    method: "post",
    url: `/base/biz/thirdPartyApi/getTttxAllService`,
    data
  });
};
